package com.hhkj.admin.bank.common.cont;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.HashSet;
import java.util.Set;

/**
 * RuleConst
 *
 * @author HHKJ-SERVER-ZJ
 * @since 2023/5/12 11:38
 */
public class RuleConst
{

    /** unify 统一、difference 区分 */
    @Getter
    @AllArgsConstructor
    public enum ConfModeType
    {
        UNIFY("unify", "统一"),
        DIFFERENCE("difference", "区分"),
        ;
        /** 编码 */
        private final String code;
        /** 名称 */
        private final String name;

        @Override
        public String toString()
        {
            return this.code;
        }
    }

    /** 练习模式 json 数据 answer：答题模式；recitation：背题模式 */
    @Getter
    @AllArgsConstructor
    public enum PracticeMode
    {
        ANSWER("answer", "答题模式"),
        RECITATION("recitation", "背题模式"),
        ;
        /** 编码 */
        private final String code;
        /** 名称 */
        private final String name;

        public static Set<String> getCodeSet() {
            Set<String> codeSet = new HashSet<>();
            for (PracticeMode mode : values()) {
                codeSet.add(mode.code);
            }
            return codeSet;
        }

        @Override
        public String toString()
        {
            return this.code;
        }
    }

    /** 类型 group 规则集、single 单个规则 */
    @Getter
    @AllArgsConstructor
    public enum Type
    {
        GROUP("group", "规则集"),
        SINGLE("single", "单个规则"),
        ;
        /** 编码 */
        private final String code;
        /** 名称 */
        private final String name;

        @Override
        public String toString()
        {
            return this.code;
        }
    }
}
